<template>
  <div class="result-page">
    <h2>测试结果</h2>
    <p v-if="result">你的MBTI类型是：<strong>{{ result.type }}</strong></p>
    <p v-else>加载中...</p>
  </div>
</template>

<script>
import { getResult } from '@/api/mbti';

export default {
  name: 'ResultPage',
  data() {
    return {
      result: null
    };
  },
  async mounted() {
    const userId = this.$route.query.user;
    const res = await getResult(userId);
    this.result = res.data;
  }
};
</script>

<style>
.result-page {
  max-width: 600px;
  margin: 40px auto;
  font-size: 18px;
}
</style>
